﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace RJ.Objects.GameEngine
{
    public class SpriteSheet : IDisposable
    {
        public Image sheet;

        public SpriteSheet(string path)
            : this(new Bitmap(path)) { }

        public SpriteSheet(Image sheet)
        {
            this.sheet = sheet;
        }

        public void DrawSprite(Graphics graphics, Sprite sprite)
        {
            graphics.DrawImage(sheet, sprite.Destination, sprite.Rectangle, GraphicsUnit.Pixel);
        }

        public Size GetDimensions()
        {
            return sheet.Size;
        }

        public void Dispose()
        {
            sheet.Dispose();
        }
    }
}
